import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
// 1. 创建路由器实例
import { createRouter, createWebHistory } from "vue-router";
// 2.配置路径与页面组件的映射关系
import Bar from "./views/Bar.vue";
import disasterwarning from "./views/disasterwarning.vue";
import Baz from "./views/Baz.vue";
import Weather30 from "./views/weather30.vue";
import lifeindex from "./views/lifeindex.vue";
var router = createRouter({
  routes: [
    { path: "/weather", name: "天气", component: Baz },
    { path: "/weather30", name: "30天预报", component: Weather30 },
    { path: "/rainfall", name: "降水", component: Bar },
    { path: "/air-quality", name: "空气质量", component: Baz },
    { path: "/disasterwarning", name: "灾害预警", component: disasterwarning },
    { path: "/lifeindex", name: "生活指数", component: lifeindex },
    { path: "/historical-data", name: "历史数据", component: Bar },
  ],
  history: createWebHistory(),
});
// 3.将路由器实例注册为vue的插件
createApp(App).use(router).mount("#app");

// 4.将vue-router提供的全局组件RouterView 插入到App.vue中
